
$(function () {
    var html_data = {
        baseConfig: baseConfig,
        sessionid: '',
        sessionid_q: '',
        address_info:{},
        old_password: '',
        new_password: '',
        new_password2: '',
        province_list:[],
        city_list:[],
        county_list:[],
        address_list: []

    };
    var app = new Vue({
        el: '#change_password_html',
        data: html_data,
        methods: {
            modefy_password: function () {
                var parm = {};
                if(html_data.new_password.length<6||html_data.new_password.length>16){
                    Magiclamp.mcAlert("提示", "密码必须大于6位或小于16位字符");
                    return;
                }
                if(html_data.new_password!=html_data.new_password2){
                    Magiclamp.mcAlert("提示", "新密码必须与确认密码一致");
                    return;
                }
                parm.oldpassword = html_data.old_password;
                parm.newpassword = html_data.new_password;
                // parm.old_password = html_data.new_password2;
                api.sys.change_password(parm).then(function () {
                    app.page_back();
                })

            },
            page_back: function () {
                baseConfig.page_back();
            }
        }
    });

    html_data.sessionid = GetQueryString('sessionid');
    if (html_data.sessionid) {
        html_data.sessionid_q = "sessionid=" + html_data.sessionid;
        client_storage('sessionid', html_data.sessionid);
    }


});
